********************************************************************************
*
**# Table 3: Do DV Judges Make Different Decisions in DV Cases? 
*
********************************************************************************

use "${DATA}/data_DV.dta", clear

********************************************************************************
*
**## Panel A 
*
********************************************************************************


# d ;
preserve ;

	keep if dv_case ==1 ;
	eststo clear ;
	local m = 1 ;
	
	/* Guilty of any charge - w/o control */
	
	eststo tab3_`m': 
	reghdfe guilty_case dv_judge , $hdfe_opts ; 
	
		estadd ysumm 					;
		estadd local cntrl	"" 			;
		local m `++m' 					;
		
	/* Guilty of any charge - w control */
	
	eststo tab3_`m': 
	reghdfe guilty_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 					;
		estadd local cntrl	"X" 		;
		local m `++m' 					;
		
	/* Number of guilty convictions - w/o control */
	
	eststo tab3_`m': 
	reghdfe guilty_count dv_judge , $hdfe_opts ;
	
		estadd ysumm 					;
		estadd local cntrl	"" 			;
		local m `++m' 					;
		
	/* Number of guilty convictions - w control */	
	
	eststo tab3_`m': 
	reghdfe guilty_count dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 					;
		estadd local cntrl	"X" 		;
		local m `++m' 					;
		
	/* Whether defendant is incarcerated - w/o control */
	
	eststo tab3_`m': 
	reghdfe incarcerated_case dv_judge , $hdfe_opts ;
	
		estadd ysumm 					;
		estadd local cntrl	"" 			;
		local m `++m' 					;
		
	/* Whether defendant is incarcerated - w control */	
	
	eststo tab3_`m': 
	reghdfe incarcerated_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 					;
		estadd local cntrl	"X" 		;
		local m `++m' 					;
		
	/* Sentence Length (in days) - w/o control */
	
	eststo tab3_`m': 
	reghdfe jail_time_case dv_judge , $hdfe_opts ;

		estadd ysumm 					;	
		estadd local cntrl	"" 			;
		local m `++m' 					;
		
	/* Sentence Length (in days) - w control */
	
	eststo tab3_`m': 
	reghdfe jail_time_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 					;	
		estadd local cntrl	"X" 		;
		local m `++m' 					;
			
	/* Export */ 
	
	esttab 	tab3_* using "${OUTPUT}/tab3.rtf", replace ${tab_optns} 
			keep(dv_judge) 
			scalars("cntrl Controls" "ymean Y Mean")
			title( {\b Table 3. Do DV Judges Make different Decisionsin DV Cases? Panel A: DV Cases});
			
	
restore	;	

# d cr 

********************************************************************************
*
**## Panel B 
*
*******************************************************************************/

# d ; 

eststo clear ;
local m = 1  ;

/* Guilty of any charge - w/o control */

eststo tab3_`m': 
reghdfe guilty_case dv_did dv_case dv_judge , $hdfe_opts ;

	estadd ysumm 					;
	estadd local cntrl	"" 			;
	local m `++m' 					;

/* Guilty of any charge - w control */

eststo tab3_`m': 
reghdfe guilty_case dv_did dv_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm 					;
	estadd local cntrl	"X" 		;
	local m `++m' 					;
			
/* Number of guilty convictions - w/o control */

eststo tab3_`m': 
reghdfe guilty_count dv_did dv_case dv_judge , $hdfe_opts ;
	
	estadd ysumm 					;
	estadd local cntrl	"" 			;
	local m `++m' 					;

/* Number of guilty convictions - w control */

eststo tab3_`m': 
reghdfe guilty_count dv_did dv_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm 					;
	estadd local cntrl	"X" 		;
	local m `++m' 					;

/* Whether defendant is incarcerated - w/o control */

eststo tab3_`m': 
reghdfe incarcerated_case dv_did dv_case dv_judge , $hdfe_opts ;
	
	estadd ysumm 					;
	estadd local cntrl	"" 			;
	local m `++m' 					;
			
/* Whether defendant is incarcerated - w control */

eststo tab3_`m': 
reghdfe incarcerated_case dv_did dv_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm 					;
	estadd local cntrl	"X" 		;
	local m `++m' 					;

/* Sentence Length (in days) - w/o control */

eststo tab3_`m': 
reghdfe jail_time_case dv_did dv_case dv_judge , $hdfe_opts ;

	estadd ysumm 					;
	estadd local cntrl	"" 			;
	local m `++m' 					;

/* Sentence Length (in days) - w control */

eststo tab3_`m': 
reghdfe jail_time_case dv_did dv_case dv_judge $cntrls , $hdfe_opts ;

		estadd ysumm 					;
		estadd local cntrl	"X" 		;
		local m `++m' 					;

/* 	Export */ 

esttab 	tab3_* using "${OUTPUT}/tab3.rtf", append ${tab_optns} 
		scalars("cntrl Controls""ymean Y Mean") 
		keep(dv_did dv_case dv_judge)
		title( {\b Panel B}) ;


# d cr

********************************************************************************
*   End of File
********************************************************************************
